import coin.exchange.hitbtc_v2.kr_rest.product as exchange_product
import coin.exchange.hitbtc_v2.kr_rest.public_client as pubc
from coin.exchange.base.kr_rest.feed_base import FeedBase


class HitbtcV2Feed(FeedBase):
  ProductType = exchange_product.HitbtcProduct

  def __init__(self, product):
    FeedBase.__init__(self, product)
    self.pub_client = pubc.HitbtcPublicClient()

  def query_book(self):
    obj = self.pub_client.query_level_book(self.product)
    self.set_book_data(obj.req_timestamp, obj.res_timestamp, obj.msg)
